package de.unistuttgart.iaas.interaction.skype.util;
import java.io.*;
import java.util.Properties;

/**
 * This class defines a object, with which all information in the file configuration.conf can be taken.
 * @author Lina Sun
 *
 */
public class ConfigFileHandler 
{
	protected String strFile = "";
	
	FileInputStream propInFile = null;
	
	public Properties propConfig = new Properties();
	
	static String skype_username = "skype_username";
	static String skype_password = "skype_password";
	static String skydb_username = "skydb_username";
	static String skydb_password = "skydb_password";
	static String skydb_url = "skydb_url";
	static String skydb_table_register = "skydb_table_register";
	static String skydb_table_sentTextMessage = "skydb_table_senttextmessage";
	static String skydb_table_sentFileMessage = "skydb_table_sentfilemessage";
	static String skydb_table_recievedTextMessage = "skydb_table_recievedtextmessage";
	static String skydb_table_recievedFileMessage = "skydb_table_recievedfilemessage";
	
	public ConfigFileHandler(String strFile)
	{
		try
		{
			propInFile = new FileInputStream(strFile);
			propConfig.load(propInFile);
		}
		catch(IOException ex)
		{
			System.out.println("ConfigFile can not be opened!");
		}
	}
	
	public String getSkype_username()
	{
		return propConfig.getProperty(skype_username);
	}
	
	public String getSkype_password()
	{
		return propConfig.getProperty(skype_password);
	}
	
	public String getSkydb_username()
	{
		return propConfig.getProperty(skydb_username);
	}
	
	public String getSkydb_password()
	{
		return propConfig.getProperty(skydb_password);
	}
	
	public String getSkydb_url()
	{
		return propConfig.getProperty(skydb_url);
	}
	
	public String getSkydb_table_register()
	{
		return propConfig.getProperty(skydb_table_register);
	}
	
	public String getSkydb_table_sentTextMessage()
	{
		return propConfig.getProperty(skydb_table_sentTextMessage);
	}
	
	public String getSkydb_table_sentFileMessage()
	{
		return propConfig.getProperty(skydb_table_sentFileMessage);
	}
	
	public String getSkydb_table_recievedTextMessage()
	{
		return propConfig.getProperty(skydb_table_recievedTextMessage);
	}
	
	public String getSkydb_table_recievedFileMessage()
	{
		return propConfig.getProperty(skydb_table_recievedFileMessage);
	}

}
